# encoding: utf-8

from sklearn.tree import DecisionTreeRegressor
from sklearn.ensemble import (
    RandomForestRegressor, 
    AdaBoostRegressor, 
    BaggingRegressor, 
    ExtraTreesRegressor
)

# 随机森林回归
def rfr(X, Y):
    trainer = RandomForestRegressor(n_estimators=6)
    t = trainer.fit(X, Y)
    return t


# 决策树
def dtr(X, Y):
    trainer = DecisionTreeRegressor(criterion='mae')
    t = trainer.fit(X, Y)
    return t


# 集成回归
def adbt(X, Y):
    trainer = AdaBoostRegressor()
    t = trainer.fit(X, Y)
    return t


# 池袋回归
def br(X, Y):
    trainer = BaggingRegressor()
    t = trainer.fit(X, Y)
    return t


# 极端树回归
def etr(X, Y):
    trainer = ExtraTreesRegressor()
    t = trainer.fit(X, Y)
    return t


